package com.rc.saas.tenant.vo.sms;

import com.rc.saas.tenant.common.annotation.Excel;
import com.rc.saas.tenant.model.sms.TenantSmsRecord;

import java.text.SimpleDateFormat;

/**
 * @author frog
 * @date 2021/4/14
 */
public class PrintSmsVo {
    @Excel(title = "会员名称")
    private String memberName;
    @Excel(title = "会员电话")
    private String memberPhone;
    @Excel(title = "记录类型")
    private String recordType;
    @Excel(title = "创建时间")
    private String createdTime;
    @Excel(title = "备注")
    private String remark;

    public PrintSmsVo(TenantSmsRecord tenantSmsRecord) {
        if (tenantSmsRecord.getMemberId() != null) {
            this.memberName = tenantSmsRecord.getMemberName();
            this.memberPhone = tenantSmsRecord.getMemberPhone();
        } else {
            this.memberName = "管理员发送";
        }

        this.remark = tenantSmsRecord.getRemark();
        if ("0".equals(tenantSmsRecord.getRecordType())) {
            this.recordType = "通知类";
        } else if ("1".equals(tenantSmsRecord.getRecordType())) {
            this.recordType = "推广类";
        }

        if (tenantSmsRecord.getCreatedTime() != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            this.createdTime = sdf.format(tenantSmsRecord.getCreatedTime()).toString();
        } else {
            this.createdTime = null;
        }
    }

    public PrintSmsVo() {
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberPhone() {
        return memberPhone;
    }

    public void setMemberPhone(String memberPhone) {
        this.memberPhone = memberPhone;
    }

    public String getRecordType() {
        return recordType;
    }

    public void setRecordType(String recordType) {
        this.recordType = recordType;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
